package OverloadExercise;

public class Student extends Person {
    private String id;
    private double score;

    public Student() {
        //无参
    }

    public Student(String name, int age, String id, double score) {
        super(name,age);//这里会调用父类的构造器
        this.id = id;
        this.score = score;
    }
    //get,set方法
    public void setId(String id)
    {
        this.id = id;
    }
    public String getId()
    {
        return id;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public double getScore() {
        return score;
    }
    //子类重写父类的方法
    public String say()
    {
        return super.say() + " id = " + id + " score=" + score;
    }
}
